﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store Manager/SM_panel.master" AutoEventWireup="true" CodeFile="SM_SalesInvoice.aspx.cs" Inherits="Store_Manager_SM_SalesInvoice" %>



<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" DataSourceID="SqlDataSource1" KeyFieldName="R_ID" 
        Width="100%">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0">
                <ClearFilterButton Visible="True">
                </ClearFilterButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn Caption="Invoice No" FieldName="R_ID" 
                ReadOnly="True" VisibleIndex="0">
                <EditFormSettings Visible="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Dealer ID" FieldName="D_id" 
                VisibleIndex="1">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Dealer Name" FieldName="D_name" 
                VisibleIndex="2">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Total Amount" FieldName="Total_Price" 
                VisibleIndex="3">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Total PV" FieldName="Toatal_PV" 
                VisibleIndex="4">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Total PV" FieldName="Total_BV" 
                VisibleIndex="5">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Cashier" FieldName="cashier_Name" 
                VisibleIndex="6">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataDateColumn Caption="Date" FieldName="Rcpt_Date" 
                VisibleIndex="7">
            </dx:GridViewDataDateColumn>
        </Columns>
        <SettingsPager PageSize="25">
        </SettingsPager>
        <Settings ShowFilterRow="True" ShowFooter="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        DeleteCommand="DELETE FROM [Tbl_Receipt] WHERE [R_ID] = @R_ID" 
        InsertCommand="INSERT INTO [Tbl_Receipt] ([D_id], [D_name], [Total_Price], [Toatal_PV], [Total_BV], [cashier_Name], [Rcpt_Date]) VALUES (@D_id, @D_name, @Total_Price, @Toatal_PV, @Total_BV, @cashier_Name, @Rcpt_Date)" 
        SelectCommand="SELECT [R_ID], [D_id], [D_name], [Total_Price], [Toatal_PV], [Total_BV], [cashier_Name], [Rcpt_Date] FROM [Tbl_Receipt]" 
        UpdateCommand="UPDATE [Tbl_Receipt] SET [D_id] = @D_id, [D_name] = @D_name, [Total_Price] = @Total_Price, [Toatal_PV] = @Toatal_PV, [Total_BV] = @Total_BV, [cashier_Name] = @cashier_Name, [Rcpt_Date] = @Rcpt_Date WHERE [R_ID] = @R_ID">
        <DeleteParameters>
            <asp:Parameter Name="R_ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="D_id" Type="String" />
            <asp:Parameter Name="D_name" Type="String" />
            <asp:Parameter Name="Total_Price" Type="Decimal" />
            <asp:Parameter Name="Toatal_PV" Type="Decimal" />
            <asp:Parameter Name="Total_BV" Type="Decimal" />
            <asp:Parameter Name="cashier_Name" Type="String" />
            <asp:Parameter Name="Rcpt_Date" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="D_id" Type="String" />
            <asp:Parameter Name="D_name" Type="String" />
            <asp:Parameter Name="Total_Price" Type="Decimal" />
            <asp:Parameter Name="Toatal_PV" Type="Decimal" />
            <asp:Parameter Name="Total_BV" Type="Decimal" />
            <asp:Parameter Name="cashier_Name" Type="String" />
            <asp:Parameter Name="Rcpt_Date" Type="DateTime" />
            <asp:Parameter Name="R_ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>



